From a81a4b130bebff1a901d063f941f0e3de0c0d7bf Mon Sep 17 00:00:00 2001 From: tsteven4 <13596209+tsteven4@users.noreply.github.com> Date: Fri, 30 Aug 2024 17:32:15 -0600 Subject: [PATCH] kill a position normilization clone caught by codacy. (#1333) --- gdb.cc | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/gdb.cc b/gdb.cc index 7cd965ed6..baf0773c8 100644 --- a/gdb.cc +++ b/gdb.cc @@ -1152,26 +1152,7 @@ GdbFormat::write_header() void GdbFormat::gdb_check_waypt(Waypoint* wpt) { - double lat_orig = wpt->latitude; - double lon_orig = wpt->longitude; - - if (wpt->latitude < -90) { - wpt->latitude += 180; - } else if (wpt->latitude > +90) { - wpt->latitude -= 180; - } - if (wpt->longitude < -180) { - wpt->longitude += 360; - } else if (wpt->longitude > +180) { - wpt->longitude -= 360; - } - - if ((wpt->latitude < -90) || (wpt->latitude > 90.0)) - fatal("Invalid latitude %f in waypoint %s.\n", - lat_orig, !wpt->shortname.isEmpty() ? qPrintable(wpt->shortname) : ""); - if ((wpt->longitude < -180) || (wpt->longitude > 180.0)) - fatal("Invalid longitude %f in waypoint %s.\n", - lon_orig, !wpt->shortname.isEmpty() ? qPrintable(wpt->shortname) : ""); + wpt->NormalizePosition(); } /*-----------------------------------------------------------------------------*/ -- 2.30.2